﻿﻿<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="1.0.0">

  <xsd:complexType name="publish">
    <xsd:annotation>
      <xsd:documentation>publish:公开出来的自定义元素</xsd:documentation>
    </xsd:annotation>
    <xsd:all>
      <!-- 注册group -->
      <xsd:element maxOccurs="1" minOccurs="0" name="services" type="services"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="orms" type="orms"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="commands" type="commands"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="querys" type="querys"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="tables" type="tables"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="pages" type="pages"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="templates" type="templates"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="ui-stylesheets" type="stylesheets"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="portlets" type="portlets"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="auth-catagorys" type="auth-catagorys"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="models" type="models"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="viewparts" type="viewparts"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="ui-entrys" type="uientrys"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="ui-client-scripts" type="ui-client-scripts"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="declare-scripts" type="declare-scripts"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="portal-datas" type="portal-datas"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="info-groups" type="info-groups"/>
      <xsd:element maxOccurs="1" minOccurs="0" name="info-groups-localization" type="info-groups-localization"/>
    </xsd:all>
  </xsd:complexType>

  <xsd:complexType name="services">
    <xsd:annotation>
      <xsd:documentation>service声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="service" type="service"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="orms">
    <xsd:annotation>
      <xsd:documentation>orm声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="orm" type="orm"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="commands">
    <xsd:annotation>
      <xsd:documentation>命令声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="command" type="command"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="querys">
    <xsd:annotation>
      <xsd:documentation>查询声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="query" type="query"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tables">
    <xsd:annotation>
      <xsd:documentation>逻辑表声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="table" type="table"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="uientrys">
    <xsd:annotation>
      <xsd:documentation>界面入口声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="uientry" type="uientry"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="pages">
    <xsd:annotation>
      <xsd:documentation>页面声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="page" type="page"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="templates">
    <xsd:annotation>
      <xsd:documentation>界面模板声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="template" type="template"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="stylesheets">
    <xsd:annotation>
      <xsd:documentation>样式单声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="stylesheet" type="stylesheet"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="portlets">
    <xsd:annotation>
      <xsd:documentation>portlet声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="portlet" type="portlet"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="auth-catagorys">
    <xsd:annotation>
      <xsd:documentation>auth-catagorys声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="auth-catagory" type="auth-catagory"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="models">
    <xsd:annotation>
      <xsd:documentation>模型声明列表</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="model" type="model"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="viewparts">
    <!-- 定义group -->
    <xsd:annotation>
      <xsd:documentation>viewparts分组定义</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="viewpart" type="viewpart"/>
      <!-- 注册element -->
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="ui-client-scripts">
    <xsd:annotation>
      <xsd:documentation>scripts分组定义</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="script" type="ui-client-script"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="declare-scripts">
    <xsd:annotation>
      <xsd:documentation>declare-scripts分组定义</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="script" type="declare-script"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="portal-datas">
    <xsd:annotation>
      <xsd:documentation>dportal-datas分组定义</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="data" type="portal-data"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="info-groups">
    <xsd:annotation>
      <xsd:documentation>info-groups分组定义</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="info-group" type="info-groups-element"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="info-groups-localization">
    <xsd:annotation>
      <xsd:documentation>info-groups-localization分组定义</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="info-group" type="info-groups-localization-element"/>
    </xsd:sequence>
    <xsd:attribute name="language" type="name" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="service">
    <xsd:annotation>
      <xsd:documentation>service声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="orm">
    <xsd:annotation>
      <xsd:documentation>orm声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="command">
    <xsd:annotation>
      <xsd:documentation>command命令声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="query">
    <xsd:annotation>
      <xsd:documentation>查询声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="table">
    <xsd:annotation>
      <xsd:documentation>逻辑表声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="uientry">
    <xsd:annotation>
      <xsd:documentation>界面入口声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="name" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="page">
    <xsd:annotation>
      <xsd:documentation>页面声明，和template声明是成对出现的</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="name" use="required"/>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="template">
    <xsd:annotation>
      <xsd:documentation>界面模板声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="name" use="required"/>
    <xsd:attribute name="path" type="path" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="stylesheet">
    <xsd:annotation>
      <xsd:documentation>样式单声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="name" use="required"/>
    <xsd:attribute name="title" type="xsd:string" use="required"/>
    <xsd:attribute name="path" type="path" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="portlet">
    <xsd:annotation>
      <xsd:documentation>portlet声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="name" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="auth-catagory">
    <xsd:annotation>
      <xsd:documentation>auth-catagory声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="model">
    <xsd:annotation>
      <xsd:documentation>model声明</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="viewpart">
    <!-- 定义element -->
    <xsd:annotation>
      <xsd:documentation>viewpart项定义</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="name"/>
    <!-- 定义属性 -->
    <xsd:attribute name="type" type="viewpartType" use="required"/>
    <xsd:attribute name="class" type="class" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="ui-client-script">
    <xsd:annotation>
      <xsd:documentation>ui-client-script项定义</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="neString" use="required"/>
    <xsd:attribute name="path" type="path" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="declare-script">
    <xsd:annotation>
      <xsd:documentation>declare-script项定义</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="path" type="path" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="portal-data">
    <xsd:annotation>
      <xsd:documentation>portal-data项定义</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="path" type="path" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="info-groups-element">
    <xsd:annotation>
      <xsd:documentation>info-groups-element项定义</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="class" type="class" use="required"/>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="visibility" type="visibility" use="optional"/>
  </xsd:complexType>

  <xsd:complexType name="info-groups-localization-element">
    <xsd:annotation>
      <xsd:documentation>info-groups-localization-element项定义</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="space" type="path" use="required"/>
    <xsd:attribute name="path" type="path" use="required"/>
  </xsd:complexType>


  <!-- 简单类型定义 -->
  <xsd:simpleType name="name">
    <xsd:annotation>
      <xsd:documentation>名称校验</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:Name"/>
  </xsd:simpleType>
  <xsd:simpleType name="path">
    <xsd:annotation>
      <xsd:documentation>路径校验</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="([a-z,A-Z,_,\.,0-9]{1,}:){0,1}(\.\./){0,}.{1,}"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="class">
    <xsd:annotation>
      <xsd:documentation>class校验</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="[a-z,A-z,_]{1,}[a-z,A-Z,0-9,_,\.]{0,}[a-z,A-Z,0-9,_]{1,}"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="neString">
    <!-- 定义属性类型 -->
    <xsd:annotation>
      <xsd:documentation>非空字符串类型</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="(.){1,}"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="viewpartType">
    <!-- 定义属性类型 -->
    <xsd:annotation>
      <xsd:documentation>viewpart类型</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="(portlet|function|document|pagetemplate|sys-function)(\,(portlet|function|document|pagetemplate|sys-function)){0,}"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="visibility">
    <xsd:annotation>
      <xsd:documentation>名称校验</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="PROTECTED|PUBLIC"/>
    </xsd:restriction>
  </xsd:simpleType>

</xsd:schema>
